home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: gail.ripco.com!mambuhl
- From: mambuhl@ripco.com (Martin Ambuhl)
- Subject: Re: Help!
- X-Nntp-Posting-Host: foley.ripco.com
- Message-ID: <DLuCuA.Arp@rci.ripco.com>
- Sender: usenet@rci.ripco.com (Net News Admin)
- Organization: Ripco Internet BBS Chicago
- Date: Sat, 27 Jan 1996 13:15:45 GMT
- X-Ident-Sender: mambuhl
-
- s3610165@maliwan.psu.ac.th (Sanon CHAOCHAIYAPORN)
- in <4ea5p4$j0s@ratree.psu.ac.th> asks:
-
-
- > There is a file, hi.bat, in my 'h:\data' directory and I try to
- >run it by C program but it fail. Please, advice to me?
-
- We will ignore the non-standard headers conio.h and dir.h and the
- non-standard functions clrscr(), chdir() and getch(). You actually have
- a C problem:
- >chdir("h:\data");
-
- replace with:
- chdir("h:\\data");
- or
- chdir("h:/data");
-
- BTW: The header stdio.h is unused, so not needed. It is a GoodIdea to
- implicitly declare the return type of main -- int main(void) -- and to
- explicitly return its value -- e.g. return 0;.
-
- >Source:
-
- >#include<stdio.h>
- >#include<stdlib.h>
- >#include<conio.h>
- >#include<dir.h>
-
- >main()
- >{
- >clrscr();
- >chdir("h:\data");
- >system("hi.bat");
- >getch();
- >}
-
-
- >--
- > ----------------------------------------------------------------
- > | | |
- > | Sanon Chaochaiyaporn | Prince of Songkla University |
- > | s3610165@maliwan.psu.ac.th | Hadyai, Thailand |
- > | | |
- > ----------------------------------------------------------------
-
- --
- * Martin Ambuhl net: mambuhl@ripco.com
- * Chicago, IL (USA)
-